// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIUpdateService.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// An interface that describes an object representing a patch file that can
    /// be downloaded and applied to a version of this application so that it
    /// can be updated.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("dc8fb8a9-3a53-4031-9469-2a5197ea30e7")]
	public interface nsIUpdatePatch
	{
		
		/// <summary>
        /// The type of this patch:
        /// "partial"      A binary difference between two application versions
        /// "complete"     A complete patch containing all of the replacement files
        /// to update to the new version
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetTypeAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aType);
		
		/// <summary>
        /// The type of this patch:
        /// "partial"      A binary difference between two application versions
        /// "complete"     A complete patch containing all of the replacement files
        /// to update to the new version
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetTypeAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aType);
		
		/// <summary>
        /// The URL this patch was being downloaded from
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aURL);
		
		/// <summary>
        /// The URL this patch was being downloaded from
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aURL);
		
		/// <summary>
        /// The final URL this patch was being downloaded from
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetFinalURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aFinalURL);
		
		/// <summary>
        /// The final URL this patch was being downloaded from
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetFinalURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aFinalURL);
		
		/// <summary>
        /// The hash function to use when determining this file's integrity
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetHashFunctionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aHashFunction);
		
		/// <summary>
        /// The hash function to use when determining this file's integrity
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetHashFunctionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aHashFunction);
		
		/// <summary>
        /// The value of the hash function named above that should be computed if
        /// this file is not corrupt.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetHashValueAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aHashValue);
		
		/// <summary>
        /// The value of the hash function named above that should be computed if
        /// this file is not corrupt.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetHashValueAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aHashValue);
		
		/// <summary>
        /// The size of this file, in bytes.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetSizeAttribute();
		
		/// <summary>
        /// The size of this file, in bytes.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetSizeAttribute(uint aSize);
		
		/// <summary>
        /// The state of this patch
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetStateAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aState);
		
		/// <summary>
        /// The state of this patch
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetStateAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aState);
		
		/// <summary>
        /// true if this patch is currently selected as the patch to be downloaded and
        /// installed for this update transaction, false if another patch from this
        /// update has been selected.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetSelectedAttribute();
		
		/// <summary>
        /// true if this patch is currently selected as the patch to be downloaded and
        /// installed for this update transaction, false if another patch from this
        /// update has been selected.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetSelectedAttribute([MarshalAs(UnmanagedType.U1)] bool aSelected);
		
		/// <summary>
        /// Serializes this patch object into a DOM Element
        /// @param   updates
        /// The document to serialize into
        /// @returns The DOM Element created by the serialization process
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDOMElement Serialize([MarshalAs(UnmanagedType.Interface)] nsIDOMDocument updates);
	}
	
	/// <summary>
    /// An interface that describes an object representing an available update to
    /// the current application - this update may have several available patches
    /// from which one must be selected to download and install, for example we
    /// might select a binary difference patch first and attempt to apply that,
    /// then if the application process fails fall back to downloading a complete
    /// file-replace patch. This object also contains information about the update
    /// that the front end and other application services can use to learn more
    /// about what is going on.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("6b0b7721-6746-443d-8cb0-c6199d7f28a6")]
	public interface nsIUpdate
	{
		
		/// <summary>
        /// The type of update:
        /// "major"  A major new version of the Application
        /// "minor"  A minor update to the Application (e.g. security update)
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetTypeAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aType);
		
		/// <summary>
        /// The type of update:
        /// "major"  A major new version of the Application
        /// "minor"  A minor update to the Application (e.g. security update)
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetTypeAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aType);
		
		/// <summary>
        /// The name of the update, or "<Application Name> <Update Version>"
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetNameAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aName);
		
		/// <summary>
        /// The name of the update, or "<Application Name> <Update Version>"
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetNameAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aName);
		
		/// <summary>
        /// The string to display in the user interface for the version. If you want
        /// a real version number use appVersion.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetDisplayVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aDisplayVersion);
		
		/// <summary>
        /// The string to display in the user interface for the version. If you want
        /// a real version number use appVersion.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetDisplayVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aDisplayVersion);
		
		/// <summary>
        /// The Application version of this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetAppVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aAppVersion);
		
		/// <summary>
        /// The Application version of this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAppVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aAppVersion);
		
		/// <summary>
        /// The Toolkit version of this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetPlatformVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aPlatformVersion);
		
		/// <summary>
        /// The Toolkit version of this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetPlatformVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aPlatformVersion);
		
		/// <summary>
        /// The Application version prior to the application being updated.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetPreviousAppVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aPreviousAppVersion);
		
		/// <summary>
        /// The Application version prior to the application being updated.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetPreviousAppVersionAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aPreviousAppVersion);
		
		/// <summary>
        /// The Build ID of this update. Used to determine a particular build, down
        /// to the hour, minute and second of its creation. This allows the system
        /// to differentiate between several nightly builds with the same |version|
        /// for example.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetBuildIDAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aBuildID);
		
		/// <summary>
        /// The Build ID of this update. Used to determine a particular build, down
        /// to the hour, minute and second of its creation. This allows the system
        /// to differentiate between several nightly builds with the same |version|
        /// for example.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetBuildIDAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aBuildID);
		
		/// <summary>
        /// The URL to a page which offers details about the content of this
        /// update. Ideally, this page is not the release notes but some other page
        /// that summarizes the differences between this update and the previous,
        /// which also links to the release notes.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetDetailsURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aDetailsURL);
		
		/// <summary>
        /// The URL to a page which offers details about the content of this
        /// update. Ideally, this page is not the release notes but some other page
        /// that summarizes the differences between this update and the previous,
        /// which also links to the release notes.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetDetailsURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aDetailsURL);
		
		/// <summary>
        /// The URL to a page that is typically localized to display in the update
        /// prompt.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetBillboardURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aBillboardURL);
		
		/// <summary>
        /// The URL to a page that is typically localized to display in the update
        /// prompt.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetBillboardURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aBillboardURL);
		
		/// <summary>
        /// The URL to a HTML fragment that contains a license for this update. If
        /// this is specified, the user is shown the license file after they choose
        /// to install the update and they must agree to it before the download
        /// commences.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetLicenseURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aLicenseURL);
		
		/// <summary>
        /// The URL to a HTML fragment that contains a license for this update. If
        /// this is specified, the user is shown the license file after they choose
        /// to install the update and they must agree to it before the download
        /// commences.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetLicenseURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aLicenseURL);
		
		/// <summary>
        /// The URL to the Update Service that supplied this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetServiceURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aServiceURL);
		
		/// <summary>
        /// The URL to the Update Service that supplied this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetServiceURLAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aServiceURL);
		
		/// <summary>
        /// The channel used to retrieve this update from the Update Service.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetChannelAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aChannel);
		
		/// <summary>
        /// The channel used to retrieve this update from the Update Service.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetChannelAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aChannel);
		
		/// <summary>
        /// Whether to show the update prompt which requires user confirmation when an
        /// update is found during a background update check. This overrides the
        /// default setting to download the update in the background.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetShowPromptAttribute();
		
		/// <summary>
        /// Whether to show the update prompt which requires user confirmation when an
        /// update is found during a background update check. This overrides the
        /// default setting to download the update in the background.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetShowPromptAttribute([MarshalAs(UnmanagedType.U1)] bool aShowPrompt);
		
		/// <summary>
        /// Whether to show the "No Thanks" button in the update prompt. This allows
        /// the user to never receive a notification for that specific update version
        /// again.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetShowNeverForVersionAttribute();
		
		/// <summary>
        /// Whether to show the "No Thanks" button in the update prompt. This allows
        /// the user to never receive a notification for that specific update version
        /// again.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetShowNeverForVersionAttribute([MarshalAs(UnmanagedType.U1)] bool aShowNeverForVersion);
		
		/// <summary>
        /// Whether the update is no longer supported on this system.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetUnsupportedAttribute();
		
		/// <summary>
        /// Whether the update is no longer supported on this system.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetUnsupportedAttribute([MarshalAs(UnmanagedType.U1)] bool aUnsupported);
		
		/// <summary>
        /// Allows overriding the default amount of time in seconds before prompting the
        /// user to apply an update. If not specified, the value of
        /// app.update.promptWaitTime will be used.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		long GetPromptWaitTimeAttribute();
		
		/// <summary>
        /// Allows overriding the default amount of time in seconds before prompting the
        /// user to apply an update. If not specified, the value of
        /// app.update.promptWaitTime will be used.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetPromptWaitTimeAttribute(long aPromptWaitTime);
		
		/// <summary>
        /// Whether or not the update being downloaded is a complete replacement of
        /// the user's existing installation or a patch representing the difference
        /// between the new version and the previous version.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsCompleteUpdateAttribute();
		
		/// <summary>
        /// Whether or not the update being downloaded is a complete replacement of
        /// the user's existing installation or a patch representing the difference
        /// between the new version and the previous version.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetIsCompleteUpdateAttribute([MarshalAs(UnmanagedType.U1)] bool aIsCompleteUpdate);
		
		/// <summary>
        /// Whether or not the update is a security update or not. If this is true,
        /// then we present more serious sounding user interface messages to the
        /// user.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsSecurityUpdateAttribute();
		
		/// <summary>
        /// Whether or not the update is a security update or not. If this is true,
        /// then we present more serious sounding user interface messages to the
        /// user.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetIsSecurityUpdateAttribute([MarshalAs(UnmanagedType.U1)] bool aIsSecurityUpdate);
		
		/// <summary>
        /// Whether or not the update being downloaded is an OS update. This is
        /// generally only possible in Gonk right now.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsOSUpdateAttribute();
		
		/// <summary>
        /// Whether or not the update being downloaded is an OS update. This is
        /// generally only possible in Gonk right now.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetIsOSUpdateAttribute([MarshalAs(UnmanagedType.U1)] bool aIsOSUpdate);
		
		/// <summary>
        /// When the update was installed.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		long GetInstallDateAttribute();
		
		/// <summary>
        /// When the update was installed.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetInstallDateAttribute(long aInstallDate);
		
		/// <summary>
        /// A message associated with this update, if any.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetStatusTextAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aStatusText);
		
		/// <summary>
        /// A message associated with this update, if any.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetStatusTextAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aStatusText);
		
		/// <summary>
        /// The currently selected patch for this update.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIUpdatePatch GetSelectedPatchAttribute();
		
		/// <summary>
        /// The state of the selected patch:
        /// "downloading"        The update is being downloaded.
        /// "pending"            The update is ready to be applied.
        /// "pending-service"    The update is ready to be applied with the service.
        /// "applying"           The update is being applied.
        /// "applied"            The update is ready to be switched to.
        /// "applied-os"         The update is OS update and to be installed.
        /// "applied-service"    The update is ready to be switched to with the service.
        /// "succeeded"          The update was successfully applied.
        /// "download-failed"    The update failed to be downloaded.
        /// "failed"             The update failed to be applied.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetStateAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aState);
		
		/// <summary>
        /// The state of the selected patch:
        /// "downloading"        The update is being downloaded.
        /// "pending"            The update is ready to be applied.
        /// "pending-service"    The update is ready to be applied with the service.
        /// "applying"           The update is being applied.
        /// "applied"            The update is ready to be switched to.
        /// "applied-os"         The update is OS update and to be installed.
        /// "applied-service"    The update is ready to be switched to with the service.
        /// "succeeded"          The update was successfully applied.
        /// "download-failed"    The update failed to be downloaded.
        /// "failed"             The update failed to be applied.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetStateAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aState);
		
		/// <summary>
        /// A numeric error code that conveys additional information about the state
        /// of a failed update or failed certificate attribute check during an update
        /// check. If the update is not in the "failed" state or the certificate
        /// attribute check has not failed the value is zero.
        ///
        /// TODO: Define typical error codes (for now, see updater/errors.h and the
        /// CERT_ATTR_CHECK_FAILED_* values in nsUpdateService.js)
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetErrorCodeAttribute();
		
		/// <summary>
        /// A numeric error code that conveys additional information about the state
        /// of a failed update or failed certificate attribute check during an update
        /// check. If the update is not in the "failed" state or the certificate
        /// attribute check has not failed the value is zero.
        ///
        /// TODO: Define typical error codes (for now, see updater/errors.h and the
        /// CERT_ATTR_CHECK_FAILED_* values in nsUpdateService.js)
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetErrorCodeAttribute(int aErrorCode);
		
		/// <summary>
        /// The number of patches supplied by this update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetPatchCountAttribute();
		
		/// <summary>
        /// Retrieves a patch.
        /// @param   index
        /// The index of the patch to retrieve.
        /// @returns The nsIUpdatePatch at the specified index.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIUpdatePatch GetPatchAt(uint index);
		
		/// <summary>
        /// Serializes this update object into a DOM Element
        /// @param   updates
        /// The document to serialize into
        /// @returns The DOM Element created by the serialization process
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDOMElement Serialize([MarshalAs(UnmanagedType.Interface)] nsIDOMDocument updates);
	}
	
	/// <summary>
    /// An interface describing an object that listens to the progress of an update
    /// check operation. This object is notified as the check continues, finishes
    /// and if it has an error.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("4aa2b4bb-39ea-407b-98ff-89f19134d4c0")]
	public interface nsIUpdateCheckListener
	{
		
		/// <summary>
        /// The update check was completed.
        /// @param   request
        /// The nsIXMLHttpRequest handling the update check.
        /// @param   updates
        /// An array of nsIUpdate objects listing available updates.
        /// @param   updateCount
        /// The size of the |updates| array.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void OnCheckComplete([MarshalAs(UnmanagedType.Interface)] nsIXMLHttpRequest request, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)] nsIUpdate[] updates, uint updateCount);
		
		/// <summary>
        /// An error occurred while loading the remote update service file.
        /// @param   request
        /// The nsIXMLHttpRequest handling the update check.
        /// @param   update
        /// A nsIUpdate object that contains details about the
        /// error in its |statusText| property.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void OnError([MarshalAs(UnmanagedType.Interface)] nsIXMLHttpRequest request, [MarshalAs(UnmanagedType.Interface)] nsIUpdate update);
	}
	
	/// <summary>
    /// An interface describing an object that knows how to check for updates.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("877ace25-8bc5-452a-8586-9c1cf2871994")]
	public interface nsIUpdateChecker
	{
		
		/// <summary>
        /// Checks for available updates, notifying a listener of the results.
        /// @param   listener
        /// An object implementing nsIUpdateCheckListener which is notified
        /// of the results of an update check.
        /// @param   force
        /// Forces the checker to check for updates, regardless of the
        /// current value of the user's update settings. This is used by
        /// any piece of UI that offers the user the imperative option to
        /// check for updates now, regardless of their update settings.
        /// force will not work if the system administrator has locked
        /// the app.update.enabled preference.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void CheckForUpdates([MarshalAs(UnmanagedType.Interface)] nsIUpdateCheckListener listener, [MarshalAs(UnmanagedType.U1)] bool force);
		
		/// <summary>
        /// Ends any pending update check.
        /// @param   duration
        /// A value representing the set of checks to stop doing.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void StopChecking(ushort duration);
	}
	
	/// <summary>nsIUpdateCheckerConsts </summary>
	public class nsIUpdateCheckerConsts
	{
		
		// <summary>
        // Constants for the |stopChecking| function that tell the Checker how long
        // to stop checking:
        //
        // CURRENT_CHECK:     Stops the current (active) check only
        // CURRENT_SESSION:   Stops all checking for the current session
        // ANY_CHECKS:        Stops all checking, any session from now on
        // (disables update checking preferences)
        // </summary>
		public const ushort CURRENT_CHECK = 1;
		
		// 
		public const ushort CURRENT_SESSION = 2;
		
		// 
		public const ushort ANY_CHECKS = 3;
	}
	
	/// <summary>
    /// An interface describing a global application service that handles performing
    /// background update checks and provides utilities for selecting and
    /// downloading update patches.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("9f9b51f5-340e-47ce-85ae-9eb077c6cd39")]
	public interface nsIApplicationUpdateService
	{
		
		/// <summary>
        /// Checks for available updates in the background using the listener provided
        /// by the application update service for background checks.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void CheckForBackgroundUpdates();
		
		/// <summary>
        /// The Update Checker used for background update checking.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIUpdateChecker GetBackgroundCheckerAttribute();
		
		/// <summary>
        /// Selects the best update to install from a list of available updates.
        /// @param   updates
        /// An array of updates that are available
        /// @param   updateCount
        /// The length of the |updates| array
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIUpdate SelectUpdate([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] nsIUpdate[] updates, uint updateCount);
		
		/// <summary>
        /// Adds a listener that receives progress and state information about the
        /// update that is currently being downloaded, e.g. to update a user
        /// interface.
        /// @param   listener
        /// An object implementing nsIRequestObserver and optionally
        /// nsIProgressEventSink that is to be notified of state and
        /// progress information as the update is downloaded.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void AddDownloadListener([MarshalAs(UnmanagedType.Interface)] nsIRequestObserver listener);
		
		/// <summary>
        /// Removes a listener that is receiving progress and state information
        /// about the update that is currently being downloaded.
        /// @param   listener
        /// The listener object to remove.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RemoveDownloadListener([MarshalAs(UnmanagedType.Interface)] nsIRequestObserver listener);
		
		/// <summary>
        ///
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void DownloadUpdate([MarshalAs(UnmanagedType.Interface)] nsIUpdate update, [MarshalAs(UnmanagedType.U1)] bool background, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
		
		/// <summary>
        /// Apply the OS update which has been downloaded and staged as applied.
        /// @param   update
        /// The update has been downloaded and staged as applied.
        /// @throws  if the update object is not an OS update.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ApplyOsUpdate([MarshalAs(UnmanagedType.Interface)] nsIUpdate update);
		
		/// <summary>
        /// Get the Active Updates directory
        /// @returns An nsIFile for the active updates directory.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIFile GetUpdatesDirectory();
		
		/// <summary>
        /// Pauses the active update download process
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void PauseDownload();
		
		/// <summary>
        /// Whether or not there is an download happening at the moment.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsDownloadingAttribute();
		
		/// <summary>
        /// Whether or not the Update Service can check for updates. This is a function
        /// of whether or not application update is disabled by the application and the
        /// platform the application is running on.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetCanCheckForUpdatesAttribute();
		
		/// <summary>
        /// Whether or not the Update Service can download and install updates.
        /// On Windows, this is a function of whether or not the maintenance service
        /// is installed and enabled. On other systems, and as a fallback on Windows,
        /// this depends on whether the current user has write access to the install
        /// directory.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetCanApplyUpdatesAttribute();
		
		/// <summary>
        /// Whether or not a different instance is handling updates of this
        /// installation.  This currently only ever returns true on Windows
        /// when 2 instances of an application are open. Only one of the instances
        /// will actually handle updates for the installation.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsOtherInstanceHandlingUpdatesAttribute();
		
		/// <summary>
        /// Whether the Update Service is able to stage updates.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetCanStageUpdatesAttribute();
	}
	
	/// <summary>
    /// An interface describing a component which handles the job of processing
    /// an update after it's been downloaded.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("74439497-d796-4915-8cef-3dfe43027e4d")]
	public interface nsIUpdateProcessor
	{
		
		/// <summary>
        /// Processes the update which has been downloaded.
        /// This happens without restarting the application.
        /// On Windows, this can also be used for switching to an applied
        /// update request.
        /// @param update The update being applied, or null if this is a switch
        /// to updated application request.  Must be non-null on GONK.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ProcessUpdate([MarshalAs(UnmanagedType.Interface)] nsIUpdate update);
	}
	
	/// <summary>
    /// An interface describing a global application service that maintains a list
    /// of updates previously performed as well as the current active update.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("f8371237-10a6-46a5-b23f-f6f7684e9d71")]
	public interface nsIUpdateManager
	{
		
		/// <summary>
        /// Gets the update at the specified index
        /// @param   index
        /// The index within the updates array
        /// @returns The nsIUpdate object at the specified index
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIUpdate GetUpdateAt(int index);
		
		/// <summary>
        /// Gets the total number of updates in the history list.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetUpdateCountAttribute();
		
		/// <summary>
        /// The active (current) update. The active update is not in the history list.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIUpdate GetActiveUpdateAttribute();
		
		/// <summary>
        /// The active (current) update. The active update is not in the history list.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetActiveUpdateAttribute([MarshalAs(UnmanagedType.Interface)] nsIUpdate aActiveUpdate);
		
		/// <summary>
        /// Saves all updates to disk.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SaveUpdates();
		
		/// <summary>
        /// Refresh the update status based on the information in update.status.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RefreshUpdateStatus();
	}
	
	/// <summary>
    /// An interface describing an object that can show various kinds of Update
    /// notification UI to the user.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("599fd3c6-ec68-4499-ada5-2997739c97a6")]
	public interface nsIUpdatePrompt
	{
		
		/// <summary>
        /// Shows the application update checking user interface and checks if there
        /// is an update available.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void CheckForUpdates();
		
		/// <summary>
        /// Shows the application update available user interface advising that an
        /// update is available for download and install. If the app.update.silent
        /// preference is true or the user interface is already displayed the call will
        /// be a no-op.
        /// @param   update
        /// The nsIUpdate object to be downloaded and installed
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ShowUpdateAvailable([MarshalAs(UnmanagedType.Interface)] nsIUpdate update);
		
		/// <summary>
        /// Shows the application update downloaded user interface advising that an
        /// update has now been downloaded and a restart is necessary to complete the
        /// update. If background is true (e.g. the download was not user initiated)
        /// and the app.update.silent preference is true the call will be a no-op.
        /// @param   update
        /// The nsIUpdate object that was downloaded
        /// @param   background
        /// Less obtrusive UI, starting with a non-modal notification alert
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ShowUpdateDownloaded([MarshalAs(UnmanagedType.Interface)] nsIUpdate update, [MarshalAs(UnmanagedType.U1)] bool background);
		
		/// <summary>
        /// Shows the application update installed user interface advising that an
        /// update was installed successfully. If the app.update.silent preference is
        /// true, the app.update.showInstalledUI preference is false, or the user
        /// interface is already displayed the call will be a no-op.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ShowUpdateInstalled();
		
		/// <summary>
        /// Shows the application update error user interface advising that an error
        /// occurred while checking for or applying an update. If the app.update.silent
        /// preference is true the call will be a no-op.
        /// @param   update
        /// An nsIUpdate object representing the update that could not be
        /// installed. The nsIUpdate object will not be the actual update when
        /// the error occurred during an update check and will instead be an
        /// nsIUpdate object with the error information for the update check.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ShowUpdateError([MarshalAs(UnmanagedType.Interface)] nsIUpdate update);
		
		/// <summary>
        /// Shows a list of all updates installed to date.
        /// @param   parent
        /// An nsIDOMWindow to set as the parent for this window. Can be null.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ShowUpdateHistory([MarshalAs(UnmanagedType.Interface)] nsIDOMWindow parent);
	}
}
